import Axios from "../../lib/request";
import axios from "axios";
//获取代理列表
export const getDelegeteList = function(data) {
  return Axios.post("/agent/list", data);
};

//获取代理详情
export const getAgentDetail = function(id) {
  return Axios.get(`/tbCustomer/detail?customerId=${id}`);
};

//修改代理状态
export const agentUpdate = function(data) {
  return Axios.put(`/agent/update`, data);
};

//删除代理数据
export const agentDelete = function(data) {
  return Axios.put(`/agent/delete`, data);
};

//积分充值
export const homePay = function(data) {
  return Axios.post("/home/pay", data);
};

//修改代理详情
// export const agentDelete = function(data) {
//   return Axios.put(`/agent/update`, data);
// };

//获取代理订单列表
const getAgentOrderList = function(id) {
  return Axios.get(`/getAgentList/${id}`);
};

export const getDelegeteDetail = function(id) {
  return axios.all([getAgentDetail(id), getAgentOrderList(id)]).then(
    axios.spread(function(delegete, order) {
      // 两个请求现在都执行完成
    })
  );
};



